#!/bin/bash

io=$(mysql -uroot -pWWW.1.com -e "show slave status\G;" 2> /dev/null | grep Slave_IO_Running | tail  -1 | awk '{print $2}')
sql=$(mysql -uroot -pWWW.1.com -e "show slave status\G;" 2> /dev/null | grep Slave_SQL_Running | head -1 | awk '{print $2}')


if [ "$io" == "Yes" ]; then
      echo "io线程为1"
else
      echo "io线程为0"
fi
if [ "$sql" == "Yes" ]; then
      echo "sql线程为1"
else
      echo "sql线程为0"
fi
      
